#ifndef YOOHOO_XMPPCORE_ERROR_H
#define YOOHOO_XMPPCORE_ERROR_H

#include "xmppcore/export.h"
#include "xmppcore/xmllangtext.h"
#include "xmppcore/xmppobject.h"
#include "xmppcore/xmppelement.h"

#include <QtCore/QObject>

namespace yoohoo_xmppcore {

class YOOHOO_XMPPCORE_EXPORT Error : virtual public XmppElement {
public:
	enum ErrorType {
		ErrorTypeStream,
		ErrorTypeStanza
	};
	virtual QString definedCondition() = 0;
	virtual void setDefinedCondition(QString definedCondition) = 0;
	virtual XmlLangText text() = 0;
	virtual void setText(XmlLangText text) = 0;
	virtual XmppObject* applicationSpecificCondition() = 0;
	virtual void setApplicationSpecificCondition(XmppObject* applicationSpecificCondition) = 0;

	virtual bool shouldCloseStream() = 0;
	virtual Error::ErrorType errorType() const = 0;
};

class ErrorCondition : public XmppObject {
public:
	ErrorCondition(QString condition = QString());
	void setCondition(QString condition);
	QString condition();

private:
	QString _condition;
};

}

#endif
